﻿namespace Yom.Common.Model
{
    using System.Data.SqlClient;

    public class SiteSet
    {
        private string _Keywords;
        private string _Description;
        private string _Theme;
        private string _SiteUrl;
        private string _SiteTitle;
        private string _Ext;
        private string _SaveFace;
        private string _Locale;
        private string _CopyRight;
        private string _BottomDesc;

        public string KeyWords { get { return this._Keywords; } set { this._Keywords = value; } }

        public string Description { get { return this._Description; } set { this._Description = value; } }

        public string Theme { get { return this._Theme; } set { this._Theme = value; } }

        public string SiteUrl { get { return this._SiteUrl; } set { this._SiteUrl = value; } }

        public string SiteTitle { get { return this._SiteTitle; } set { this._SiteTitle = value; } }

        public string Ext { get { return this._Ext; } set { this._Ext = value; } }

        public string SaveFace { get { return this._SaveFace; } set { this._SaveFace = value; } }

        public string Locale { get { return this._Locale; } set { this._Locale = value; } }

        public string CopyRight { get { return this._CopyRight; } set { this._CopyRight = value; } }

        public string BottomDesc { get { return this._BottomDesc; } set { this._BottomDesc = value; } }

        public static SiteSet GetSet()
        {
            SqlDataReader dr = new Yom.Data.Setting().GetSet();
            SiteSet Set = new SiteSet();
            while (dr.Read())
            {
                Set.CopyRight = dr["CopyRight"].ToString();
                Set.BottomDesc = dr["BottomDesc"].ToString();
                Set.Description = dr["Description"].ToString();
                Set.Ext = dr["Ext"].ToString();
                Set.KeyWords = dr["KeyWords"].ToString();
                Set.Locale = dr["Locale"].ToString();
                Set.SaveFace = dr["SaveFace"].ToString();
                Set.SiteTitle = dr["SiteTitle"].ToString();
                Set.SiteUrl = dr["SiteUrl"].ToString();
                Set.Theme = dr["Theme"].ToString();
            }            
            dr.Close();
            dr.Dispose();

            return Set;
        }
    }
}